home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / gs24src.zip / GXBITMAP.H < prev    next >
C/C++ Source or Header  |  1992-01-09  |  2KB  |  58 lines

  1. /* Copyright (C) 1989 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gxbitmap.h */
  21. /* Definitions for stored bitmaps for Ghostscript */
  22.  
  23. #ifndef gxbitmap_INCLUDED
  24. #  define gxbitmap_INCLUDED
  25.  
  26. /*
  27.  * Drivers such as the X driver and the command list (band list) driver
  28.  * benefit greatly by being able to cache bitmaps (tiles and characters)
  29.  * and refer to them later.  To support this, we define a bitmap ID type
  30.  * which the kernel passes to the driver on each copy_ or tile_ operation.
  31.  */
  32. typedef unsigned long gx_bitmap_id;
  33. #define gx_no_bitmap_id 0L
  34.  
  35. /*
  36.  * Structure for describing stored bitmaps.
  37.  * Bitmaps are stored bit-big-endian (i.e., the 2^7 bit of the first
  38.  * byte corresponds to x=0), as a sequence of bytes (i.e., you can't
  39.  * do word-oriented operations on them if you're on a little-endian
  40.  * platform like the Intel 80x86 or VAX).  Each scan line must start on
  41.  * a (32-bit) word boundary, and hence must be is padded to a word boundary,
  42.  * although this should rarely be of concern, since the raster and width
  43.  * are specified individually.  The first scan line corresponds to y=0
  44.  * in whatever coordinate system is relevant.
  45.  *
  46.  * For bitmaps used as halftone tiles, we may replicate the tile in
  47.  * X and/or Y, but it is still valuable to know the true tile dimensions.
  48.  */
  49. typedef struct gx_bitmap_s {
  50.     byte *data;
  51.     int raster;            /* bytes per scan line */
  52.     gs_int_point size;        /* width, height */
  53.     gx_bitmap_id id;
  54.     ushort rep_width, rep_height;    /* true size of tile */
  55. } gx_bitmap;
  56.  
  57. #endif                    /* gxbitmap_INCLUDED */
  58.